package com.tian.controller;

import com.tian.DubboService;
import com.tian.HelloService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @RequestMapping("/hello")
    public String hello(){
        return "hello, SmartDragon!";
    }

    @DubboReference(version = "1.0")
    private HelloService helloService;

    @DubboReference(version = "2.0")
    private DubboService dubboService;

    @RequestMapping("/dubbo")
    public String dubbo(){
        return helloService.hello();
    }

    @RequestMapping("/dubbo2")
    public String dubbo2(){
        return dubboService.sayHello();
    }
}
